package com.tsing.wms.exception;

/**
 * 路由错误码定义接口
 *
 * @author TheTsing
 */
public interface CommonException {

    int PROXYERR = 800;

    enum Proxy implements ExceptionType {
        TOKEN_IS_REQUIRED(PROXYERR + 1, "token不能为空"),
        TOKEN_VERIFY_ERROR(PROXYERR + 2, "登录已失效，请重新登录"),
        ACCOUNT_LIMIT_LOGIN(PROXYERR + 3, "账号被限制登录，请15分钟后重试"),
        AUTHORIZATION_EXCEPTION(PROXYERR + 4, "您没有权限操作，请与管理员联系"),
        MD5_ENCODE_ERROR(PROXYERR + 5, "md5加密错误"),


        USER_IS_NULL(PROXYERR + 6, "用户不存在"),
        PASSWORD_ERROR(PROXYERR + 7, "密码错误"),
        PHONE_IS_NOTNULL(PROXYERR + 8, "手机号已存在"),
        USER_RELEVANCE_SUPPLIER(PROXYERR + 9, "删除失败，用户关联有供应商"),
        USER_RELEVANCE_STOREHOUSE(PROXYERR + 10, "删除失败，用户关联有仓库"),
        USER_RELEVANCE_OUT_IN_RECORD(PROXYERR + 11, "删除失败，用户关联有出入库记录"),
        USER_RELEVANCE_ORDER(PROXYERR + 12, "删除失败，用户关联有订单"),
        REGION_IS_NOTNULL(PROXYERR + 13, "地区已存在"),
        REGION_RELEVANCE_SUPPLIER(PROXYERR + 14, "删除失败，地区关联有供应商"),
        SUPPLIER_IS_NOTNULL(PROXYERR + 15, "供应商已存在"),
        SUPPLIER_RELEVANCE_GOODS(PROXYERR + 16, "删除失败，供应商关联有货物"),
        SUPPLIER_RELEVANCE_ORDER(PROXYERR + 17, "删除失败，供应商关联有订单"),
        GOODS_IS_NOTNULL(PROXYERR + 18, "货物已存在"),
        GOODS_RELEVANCE_STOCK(PROXYERR + 19, "删除失败，货物关联有库存"),
        GOODS_RELEVANCE_RECORD_DETAIL(PROXYERR + 20, "删除失败，货物关联有记录清单"),
        STORE_IS_NOTNULL(PROXYERR + 21, "仓库已存在"),
        STORE_RELEVANCE_STOCK(PROXYERR + 22, "删除失败，仓库关联有库存"),
        STORE_RELEVANCE_RECORD(PROXYERR + 23, "删除失败，货物关联有出入库记录"),
        ORDER_CHANGE_ERROR(PROXYERR + 24, "该订单不能被修改"),
        OUT_RECORD_ERROR(PROXYERR + 25, "出库失败，库存不足"),
        STOCK_IS_NOTNULL(PROXYERR + 26, "当前记录已存在"),


        OTHER(PROXYERR, "系统错误");

        private int code;
        private String description;

        Proxy(int code, String description) {
            this.code = code;
            this.description = description;
        }

        @Override
        public int getCode() {
            return code;
        }

        @Override
        public String getDescription() {
            return description;
        }

    }

}
